'''
Created on 05/02/2010

@author: rl49
'''
import sqlite3
import sys

sys.path.append("U:\\Eclipse Workspace\\base\\src")
print "path = ", sys.path

import database
import resource
import uri

conn = sqlite3.connect("D:\\Workstation Configuration\\Documents and Settings\\rl49\\Desktop\\temp.datastore")
conn.row_factory = sqlite3.Row

print "before PRAGMA..."
cursor = conn.cursor()
cursor.execute("""PRAGMA locking_mode=EXCLUSIVE""")
cursor.close()
conn.commit()

print "before SELECT..."
cursor = conn.cursor()
cursor.execute("""SELECT * FROM RESOURCE""")
cursor.close()
conn.commit()

print "before put..."
dataStore = database.DataStore("D:\\Workstation Configuration\\Documents and Settings\\rl49\\Desktop\\temp.datastore")
resource = resource.Resource()
key_uri = uri.Uri('http://yarra-project.com/richard/lee/')
resource.set_metadata(key_uri, value="Richard 2")
resource.content = "Richard Lee 2"
dataStore.put([resource], conn)
conn.commit()
conn.close()